﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chilis.Marketing.Common;
using System.Data.SqlClient;
using System.Data;

namespace Chilis.Marketing.Data.Access
{
    public class DAGeneral : ConexionBD
    {
        #region ATRIBUTOS

        private SqlCommand cmd;

        #endregion

        #region CONSTRUCTOR
        #endregion

        #region PROPIEDADES
        #endregion

        #region METODOS

        /// <summary>
        /// Función             : obtenerEstadoCampanha
        /// Descripción         : Obtiene los diversos estado de la Campaña
        /// Fecha Creacion      : 25/03/2013
        /// Creador             : Eduardo Loo
        /// Ultimo en modificar : Eduardo Loo
        /// Ultima modificacion : 25/03/2013
        /// </summary>
        public DataTable obtenerEstadoCampanha()
        {
            DataTable dt = new DataTable();
            SqlDataAdapter da = null;
            this.Conexion();
            cmd = new SqlCommand();
            cmd.Connection = this.connection;

            this.AbrirConexion();

            cmd.CommandText = "spListarEstadoCampanha";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Clear();

            try
            {
                da = new SqlDataAdapter(cmd);
                da.Fill(dt);
            }
            catch (Exception ex)
            {
                dt = null;
                throw ex;
            }
            finally
            {
                if (da != null)
                {
                    da.Dispose();
                }
                cmd.Dispose();
                this.CerrarConexion();
            }
            return dt;
        }


        
        #endregion
    }
}
